import { IsString, IsNotEmpty, IsOptional, IsEmail, IsNumber, IsMongoId } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class CreateOrganizationDto {
  @ApiProperty({ description: '组织名称', example: '总公司' })
  @IsString()
  @IsNotEmpty()
  name: string;

  @ApiPropertyOptional({ description: '组织编码', example: 'ORG001' })
  @IsString()
  @IsOptional()
  code?: string;

  @ApiPropertyOptional({ description: '父组织ID' })
  @IsMongoId()
  @IsOptional()
  parentId?: string;

  @ApiPropertyOptional({ description: '组织描述' })
  @IsString()
  @IsOptional()
  description?: string;

  @ApiPropertyOptional({ description: '排序号', example: 1 })
  @IsOptional()
  order?: number;

  @IsString()
  @IsOptional()
  address?: string;

  @IsString()
  @IsOptional()
  contactPerson?: string;

  @IsString()
  @IsOptional()
  phone?: string;

  @IsEmail()
  @IsOptional()
  email?: string;

  @IsNumber()
  @IsOptional()
  status?: number;

  @IsNumber()
  @IsOptional()
  sort?: number;
} 